//接口数据显示jsonview   http://localhost:8080/api/look
// const router = require("koa-router")();

const Router = require("koa-router")
const router = new Router();
// console.log(router instanceof Router);//config/index.js  requireDirectory
const MembersModel = require("../../models/Members")
// 查询数据库
router.get("/api/last",async ctx=>{
    // ctx.body = "api"
    var data = await MembersModel.find({});
    console.log(ctx.request.header.host)
    ctx.body ={
        code:200,
        result:data[0],
        msg:"第一条"
    }
})
module.exports = router;